<!-- temporary from product -->

<?php use_helper('Number') ?>
<?php use_helper('Javascript') ?>
<?php /* @var $product Product */ ?>

<!-- pagrindinis menu -->
<ol id="expandsubmenu">

<?php 	$arCategoryRoot = Category::getList(0); ?>

<?php //debugvar($arCategoryRoot, 'arCategoryRoot')?>

	<?php foreach($arCategoryRoot as $key => $val): ?>
        <?php echo link_to($val
                        , '#'
                        , array( 'onclick' => 'menuChildCategory('. $key .')'))?>
<!-- child category -->

<div id="menu_child_category_<?php echo $key?>">
</div>

<!-- /child category -->

	<?php endforeach; ?>

<!-- /pagrindinis menu -->

</ol>
<script type="text/javascript">
function menuChildCategory(id)
{
    jQuery.ajax({
        type: "post"
        , data: ({'parent_id' : id})
        , dataType: "html"
        , url: "/public_html/test.php/category/getcat"
        , success: function(data) {
            jQuery('#menu_child_category_'+id).html(data);
          }
    });
}
</script>